<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="com.hikvision.artemis.sdk.ArtemisHttpUtil" %>
<%@ page import="com.alibaba.fastjson.JSON" %>
<%@ page import="com.hikvision.artemis.sdk.config.ArtemisConfig" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="org.apache.commons.lang3.StringUtils" %><%
    out.println("get door info start.");
    try {
        String type = Util.null2String(request.getParameter("type"));
        String http = "https://";
        if (StringUtils.equals(type, "1")) {
            http = "http://";
        }
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("pageNo", "1");
        map.put("pageSize", "1000");
        String result = null;
        ArtemisConfig c = new ArtemisConfig();
        c.setHost("192.168.5.250:10443");
        c.setAppKey("20685357");
        c.setAppSecret("gD4qCz1iprH4jiNLXu7A");
        String getCamsApi = "/artemis/api/resource/v2/door/search";
        String finalHttp = http;
        Map<String, String> path = new HashMap<String, String>(2) {
            {
                put(finalHttp, getCamsApi);
            }
        };
        result = ArtemisHttpUtil.doPostStringArtemis(c, path, JSON.toJSON(map).toString(),
                null, null, "application/json");
        out.println("door info result:" + result);
    } catch (Exception e) {
        out.println("get door info error:" + e);
    }
    out.println("get door info end.");
%>